package com.aleaho.cftrack.font;

import android.support.annotation.StringDef;

import com.beardedhen.androidbootstrap.font.FontAwesome;
import com.beardedhen.androidbootstrap.font.IconSet;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.HashMap;
import java.util.Map;

/**
 * @author Aleaho
 * @date 2017/11/9
 * @version 1.0
 * @desc 自定义的一个IconFont类，使用阿里巴巴的
 */

public class NewIcon implements IconSet {

    public static final String FONT_PATH = "iconfont.ttf";


    @Override
    public CharSequence unicodeForKey(@FontAwesome.Icon CharSequence key) {
        return ICON_MAP.get(key);
    }

    @Override
    public CharSequence iconCodeForAttrIndex(int index) {
        return ATTR_MAP.get(index);
    }

    @Override
    public CharSequence fontPath() {
        return FONT_PATH;
    }


    private static final Map<String, String> ICON_MAP = new HashMap<>();
    private static final Map<Integer, String> ATTR_MAP = new HashMap<>();


    @Retention(RetentionPolicy.SOURCE)
    @StringDef({
            ICON_GUIJI,
            ICON_LIEBIAO,
            ICON_QIANDAO,
            ICON_WEIZHI,
            ICON_SHANGHU,
            ICON_YINHANG,
            ICON_YUANGONG,
            ICON_RIZHI,
            ICON_WAICHU,
            ICON_XIANGJI,
            ICON_ZHENGQUE,
            ICON_JIANTOUYOU,
            ICON_JIANTOUSHANG,
            ICON_JIANTOUXIA,
            ICON_JIANTOUZUO,
            ICON_TISHISHUOMING,
            ICON_GUANBI,

    })public @interface Icon {
    }

    public static final String ICON_GUIJI = "icon_guiji";
    public static final String ICON_LIEBIAO = "icon_liebiao";
    public static final String ICON_QIANDAO = "icon_qiandao";
    public static final String ICON_WEIZHI = "icon_weizhi";
    public static final String ICON_SHANGHU = "icon_shanghu";
    public static final String ICON_YINHANG = "icon_yinhang";
    public static final String ICON_YUANGONG = "icon_yuangong";
    public static final String ICON_RIZHI = "icon_rizhi";
    public static final String ICON_WAICHU = "icon_waichu";
    public static final String ICON_XIANGJI = "icon_xiangji";
    public static final String ICON_ZHENGQUE = "icon_ZHENGQUE";
    public static final String ICON_JIANTOUYOU = "icon_jiantouyou";
    public static final String ICON_JIANTOUSHANG = "icon_jiantoushang";
    public static final String ICON_JIANTOUXIA = "icon_jiantouxia";
    public static final String ICON_JIANTOUZUO = "icon_jiatouzuo";
    public static final String ICON_TISHISHUOMING = "icon_tishishuoming";
    public static final String ICON_GUANBI = "icon_guanbi";

    static {
        ICON_MAP.put(ICON_GUIJI, "\ue600");
        ICON_MAP.put(ICON_LIEBIAO, "\ue603");
        ICON_MAP.put(ICON_QIANDAO, "\ue612");
        ICON_MAP.put(ICON_WEIZHI, "\ue614");
        ICON_MAP.put(ICON_SHANGHU, "\ue605");
        ICON_MAP.put(ICON_YINHANG, "\ue61a");
        ICON_MAP.put(ICON_YUANGONG, "\ue625");
        ICON_MAP.put(ICON_RIZHI, "\ue6db");
        ICON_MAP.put(ICON_WAICHU, "\ue798");
        ICON_MAP.put(ICON_XIANGJI, "\ue660");
        ICON_MAP.put(ICON_ZHENGQUE, "\ue664");
        ICON_MAP.put(ICON_JIANTOUYOU, "\ue620");
        ICON_MAP.put(ICON_JIANTOUSHANG, "\ue63c");
        ICON_MAP.put(ICON_JIANTOUXIA, "\ue63d");
        ICON_MAP.put(ICON_JIANTOUZUO, "\ue63e");
        ICON_MAP.put(ICON_TISHISHUOMING, "\ue64c");
        ICON_MAP.put(ICON_GUANBI, "\ue604");


    }








}
